package com.easytopit.demo.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import com.easytopit.demo.domain.Hall;

/**
 * @author YWQ
 *
 */
public interface HallMapper {

	/**
	 * 录入影厅
	 * @param hall
	 * @return
	 */
	@Insert({
		"insert into hall(cinemaName,name,quantity,seat "
		+ "values(#{cinemaName},#{name},#{quantity},#{seat})"
	})
	@Options(useGeneratedKeys=true,keyProperty="id")
	public int insert (Hall hall);
	
	/**
	 * 修改影厅信息
	 * @param cinemaName
	 * @param name
	 * @param quantity
	 * @param seat
	 * @return
	 */
	@Update({
		"update hall set cinemaName=#{cinemaName},name=#{name},quantity=#{quantity},seat=#{seat} where id={id}"
	})
	public int update(@Param("cinemaName")String cinemaName,@Param("name")String name,
		@Param("quantity")Integer quantity,@Param("seat")String seat);
}